package scjp.preparation.exception;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

import javax.management.RuntimeErrorException;

public class PreciseRethrow {

	public static void main(String[] str) throws FileNotFoundException {
//		try {
//			foo();
//		} catch (NumberFormatException e) {
//			e.printStackTrace();
//		}
		try {
			FileInputStream fis = new FileInputStream(str[0]);
			} catch (ArrayIndexOutOfBoundsException aioobe) {
			System.out.println("Error: No arguments passed in the commandline!");
			System.out.println("Pass the name of the file to open as commandline argument");
			}
	}

	static private void foo() {
		try {
			int i = Integer.parseInt("ten");
		}
		catch(Exception e) {
			throw new RuntimeException(e);
		}
		finally {
			System.out.println("Finally");
		}
	}
}
